<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Comment Details</f:facet>


        <s:decorate id="added" template="layout/display.xhtml">
            <ui:define name="label">Added</ui:define>
            <h:outputText value="#{commentHome.instance.added}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="content" template="layout/display.xhtml">
            <ui:define name="label">Content</ui:define>
            <h:outputText value="#{commentHome.instance.content}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/CommentEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty commentFrom ? 'CommentList' : commentFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Answer to</h:panelGroup>
        </f:facet>
    <div class="association" id="answerToParent">

        <h:outputText value="There is no answerTo associated with this comment."
                   rendered="#{commentHome.instance.answerTo == null}"/>

        <rich:dataTable var="_comment"
                   value="#{commentHome.instance.answerTo}"
                rendered="#{commentHome.instance.answerTo != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="answerToTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_comment.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Added</f:facet>
                <h:outputText value="#{_comment.added}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Answer to id</f:facet>
                <h:outputText value="#{_comment.answerTo.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Author id</f:facet>
                <h:outputText value="#{_comment.author.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Content</f:facet>
                <h:outputText value="#{_comment.content}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Photo id</f:facet>
                <h:outputText value="#{_comment.photo.id}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewcomment"
                     value="View"
                      view="/Comment.xhtml">
                    <f:param name="commentId"
                           value="#{_comment.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Author</h:panelGroup>
        </f:facet>
    <div class="association" id="authorParent">

        <h:outputText value="There is no author associated with this comment."
                   rendered="#{commentHome.instance.author == null}"/>

        <rich:dataTable var="_user"
                   value="#{commentHome.instance.author}"
                rendered="#{commentHome.instance.author != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="authorTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_user.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Dsc</f:facet>
                <h:outputText value="#{_user.dsc}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Email</f:facet>
                <h:outputText value="#{_user.email}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Firstname</f:facet>
                <h:outputText value="#{_user.firstname}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Lastloggedin</f:facet>
                <h:outputText value="#{_user.lastloggedin}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Lastname</f:facet>
                <h:outputText value="#{_user.lastname}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Password</f:facet>
                <h:outputText value="#{_user.password}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Registered</f:facet>
                <h:outputText value="#{_user.registered}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Role id</f:facet>
                <h:outputText value="#{_user.role.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Status id</f:facet>
                <h:outputText value="#{_user.status.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Username</f:facet>
                <h:outputText value="#{_user.username}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewuser"
                     value="View"
                      view="/User.xhtml">
                    <f:param name="userId"
                           value="#{_user.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Photo</h:panelGroup>
        </f:facet>
    <div class="association" id="photoParent">

        <h:outputText value="There is no photo associated with this comment."
                   rendered="#{commentHome.instance.photo == null}"/>

        <rich:dataTable var="_photo"
                   value="#{commentHome.instance.photo}"
                rendered="#{commentHome.instance.photo != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="photoTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_photo.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Added</f:facet>
                <h:outputText value="#{_photo.added}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Album id</f:facet>
                <h:outputText value="#{_photo.album.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Camera brand</f:facet>
                <h:outputText value="#{_photo.cameraBrand}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Camera model</f:facet>
                <h:outputText value="#{_photo.cameraModel}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Date taken</f:facet>
                <h:outputText value="#{_photo.dateTaken}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Dsc</f:facet>
                <h:outputText value="#{_photo.dsc}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Filesize</f:facet>
                <h:outputText value="#{_photo.filesize}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Link</f:facet>
                <h:outputText value="#{_photo.link}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Originalheight</f:facet>
                <h:outputText value="#{_photo.originalheight}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Originalwidth</f:facet>
                <h:outputText value="#{_photo.originalwidth}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Owner id</f:facet>
                <h:outputText value="#{_photo.owner.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Status id</f:facet>
                <h:outputText value="#{_photo.status.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Title</f:facet>
                <h:outputText value="#{_photo.title}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Type</f:facet>
                <h:outputText value="#{_photo.type}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Viewed</f:facet>
                <h:outputText value="#{_photo.viewed}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewphoto"
                     value="View"
                      view="/Photo.xhtml">
                    <f:param name="photoId"
                           value="#{_photo.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
